<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<s:include value="/include/header/header.jsp"></s:include>
	Promo Offering
<s:include value="/include/header/mainNav.jsp"></s:include>
	<!--NAV ENDS HERE-->
    <!--DISPLAY STARTS HERE-->
    <div id="display">
    <!--DISPLAY INNER STARTS HERE-->
	<div id="display-inner">
		<h1>Promo Offerings - Promotion <s:property value="%{promotion.description}" /></h1>
		<table>
			<tr>
				<td class="table-width">Option</td>
				<td class="table-width">ID</td>
				<td class="table-width">Description</td>
				<td class="table-width">Initial Offering</td>
				<td class="table-width">Final Offering</td>
			</tr>
			<s:iterator value="promoOfferings" var="off">
				<tr>
					<td class="table-width"><a href="promoOffering.action?offeringId=<s:property value='#off.id'/>&promotionId=<s:property value='#off.promotion.id'/>">Edit</a></td>
					<td class="table-width"><s:property value="#off.id" /></td>
					<td class="table-width"><s:property value="#off.description" /></td>
					<td class="table-width"><s:property value="#off.initialOffering.description" /></td>
					<td class="table-width"><s:property value="#off.finalOffering.description" /></td>
				</tr>
			</s:iterator>

		</table>

		<form action="promoOffering" >
			<p class="paragraph-form">
				<s:textfield name="offering.description" label="Description" cssClass ="input-field" />
			</p>
			
			<p class="paragraph-form">
				<s:select label="InitialOffering"
						name="initialOffering"
						value="offering.initialOffering.id"
   						list="offerings"
   						cssClass="dropdown" 
   						listKey="id"
   						listValue="description"/>
			</p>
			
			<p class="paragraph-form">
				<s:select label="FinalOffering"
						name="finalOffering"
						value="offering.finalOffering.id"
   						list="offeringsTwo"
   						cssClass="dropdown" 
   						listKey="id"
   						listValue="description"/>
			</p>
			
			<p>
				<s:hidden name="offering.id" />
				<s:hidden name="offeringPromotion" value="%{promotion.id}" />
				<s:submit value="Create" id="submit-button-2" />
			</p>
			<br>
		</form>

		<s:include value="/include/footer/footer.jsp"></s:include>		
